package com.ten.jinxiancun.controller;

import com.ten.jinxiancun.server.impl.PurchasestorageDetailsServerImpl;
import com.ten.jinxiancun.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

//采购入库明细
@RestController
    @RequestMapping("/PurAD")
public class PurchasestorageDetailsController {
    @Autowired
    PurchasestorageDetailsServerImpl purAD;

    @RequestMapping("/getAllPuragDe")
    public Object getAllPuragDeFind(@RequestParam Map<String, Object> map) {
        Integer limit = Integer.parseInt(map.get("limit").toString());
        Integer page = Integer.parseInt(map.get("page").toString());
        map.put("limit", limit);
        map.put("page", (page - 1) * limit);
        Result res = new Result("0", "true", purAD.countFind(map), purAD.getAllPuragDeFind(map));
        return res;
    }
}
